function createNodes(widthCount, heightCount) {
    let nodes = [];
    for (let i = 0; i < widthCount; i++) {
        for (let j = 0; j < heightCount; j++) {
            nodes.push({
                x: Math.random() * window.innerWidth,
                y: Math.random() * window.innerHeight,
                value: 1
            });
        }
    }
    return nodes;
}
function createEdges(widthCount, heightCount) {
    let edges = [];
    for (let i = 0; i < widthCount; i++) {
        for (let j = 0; j < heightCount; j++) {
            if (i < widthCount - 1) {
                edges.push({
                    source: i + j * widthCount,
                    target: i + 1 + j * widthCount,
                    value: 1
                });
            }
            if (j < heightCount - 1) {
                edges.push({
                    source: i + j * widthCount,
                    target: i + (j + 1) * widthCount,
                    value: 1
                });
            }
        }
    }
    return edges;
}
let nodes = createNodes(50, 50);
let edges = createEdges(50, 50);
let Template = [
    {
        id: 'GraphGL01_0001',
        component: 'GraphGL01', // GL关系图
        style: {
            width: {
                value: 500,
                pixel: 500,
                unit: 'px'
            },
            height: {
                value: 350,
                pixel: 350,
                unit: 'px'
            },
            top: {
                value: 0,
                pixel: 0,
                unit: 'px'
            },
            left: {
                value: 0,
                pixel: 0,
                unit: 'px'
            },
            bottom: {
                value: '',
                unit: 'px'
            },
            right: {
                value: '',
                unit: 'px'
            },
            backgroundImage: {
                angle: 90,
                color: []
            },
            borderRadius: {
                value: 0,
                unit: 'px'
            },
            borderWidth: 0,
            borderStyle: 'solid',
            borderColor: '#FFFFFF',
            boxShadow: {
                level: 0,
                vertical: 0,
                blur: 0,
                spread: 0,
                color: '#000000FF'
            },
            rotate: 0,
            opacity: 100,
            'z-index': '1',
            backdropFilter: 0,
            filter: 0
        },
        attribute: {
            visible: true,
            chartOption: {
                type: 'graphGL',
                option: {
                    series: [
                        {
                            type: 'graphGL',
                            nodes: nodes,
                            edges: edges,
                            itemStyle: {
                                color: 'rgba(255,255,255,0.8)'
                            },
                            lineStyle: {
                                color: 'rgba(255,255,255,0.8)',
                                width: 3
                            },
                            forceAtlas2: {
                                steps: 5,
                                jitterTolerence: 10,
                                edgeWeightInfluence: 4
                            }
                        }
                    ]
                }
            }, // echarts统计图模板 object
            interval: -1, // 定时器间隔（毫秒） number
            page: 0,
            highlight: false,
            locked: false
        },
        animate: [],
        event: [],
        data: {
            url: '',
            key: [],
            type: 'static',
            datatype: 'json',
            method: '0',
            field: [],
            value: [] // 二维数组 存静态数据 二维数组
        }
    }
]

export default Template;